package TwoDay;
//4.判断一个数是不是素数
public class StudyFor4 {
    public static void main(String[] args) {
        System.out.println("请输入n");
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        boolean flag = true;
        for (int i = 2; i <= n - 1; i++) {
            if (n % i == 0) {
                flag = false;
                break;
            }
        }
        if (flag) {
            System.out.println("是素数");
        }else {
            System.out.println("不是素数");
        }
    }
}
